<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>123456</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>

    <style>
        .mt_20 {
            margin-top: 20px;
        }
    </style>
</head>

<body>



    <div id="app">

        <el-input class="mt_20" v-model="positoin_top" placeholder="请输入Top"></el-input>
        <el-input class="mt_20" v-model="positoin_left" placeholder="请输入Left"></el-input>



        <el-button class="mt_20" @click="SetFormPosition">通过websocket调winform后台逻辑</el-button>

        <el-button class="mt_20" @click="SetFormPositionRandom">随机点</el-button>



    </div>

    <script src="./socketStatic/js/websocket.js"></script>
    <script src="./socketStatic//js/bridge.js"></script>

    <script>
        new Vue({
            el: '#app',
            data: function () {
                return {
                    positoin_top: 0,
                    positoin_left: 0
                }
            },
            methods: {
                SetFormPosition: function () {
                    var that = this;
                    Bridge.WebToNative.form.SetFormPosition({
                        Top: that.positoin_top,
                        Left: that.positoin_left
                    });
                },
                SetFormPositionRandom: function () {
                    var that = this;
                    Bridge.WebToNative.form.SetFormPosition({
                        Top: parseInt(Math.random() * 1200),
                        Left: parseInt(Math.random() * 1200)
                    });
                }
            }
        })
    </script>


</body>

</html>